package com.attendance.Utils.Converter;

import com.attendance.Utils.DateUtil;
import com.attendance.model.Apply;
import com.attendance.model.Form.ApplyForm;

/**
 * Created by OPTIPLEX on 2016/12/1.
 */
public class ApplyConverter {

    public static Apply convert(ApplyForm applyForm){
        Apply apply = new Apply();
        apply.setId(applyForm.getId());
        apply.setUid(applyForm.getUid());
        apply.setStartTime(DateUtil.toDate(applyForm.getStart()));
        apply.setEndTime(DateUtil.toDate(applyForm.getEnd()));
        apply.setType(applyForm.getType());
        apply.setState(applyForm.getState());
        apply.setTotal(applyForm.getTotal());
        apply.setReason(applyForm.getReason());
        apply.setInstructions1(applyForm.getInstructions1());
        apply.setInstructions2(applyForm.getInstructions2());
        apply.setInstructions3(applyForm.getInstructions3());
        apply.setMemo(applyForm.getMemo());
        return apply;
    }

}
